import request from "@/utils/request";
import { apiUrl, objKeySort, Md5 } from "@/utils/public";

export function getInfo(url, params, method) {
  let data = Object.assign(
    {
      sign: Md5(
        objKeySort(Object.assign(apiUrl().name)) + apiUrl().appsecret
      ),
    },
    apiUrl().name,
    params
  );
  let key = method ? 'data' : 'params'
  return request({
    url,
    method: method || "get",
    [key]: data
  });
}